import { createRouter, createWebHistory } from "vue-router";
import routes from "./routes";
const router = createRouter({
    history: createWebHistory(),
    routes,
});

// 路由守卫
router.beforeEach((to,_from, next) => {
    // 文档标题
    if (to.meta.title) {
        const title = to.meta.title as string;
        document.title = title;
    }
    next();

});

export default router;
